<%@ page pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/base/taglibs.jsp"%>

<html>
	<head>
		<link href="${ctx}/css/main.css" rel="stylesheet" type="text/css" />
	</head>
    <script language="javascript">
		function submitAction(action){
			document.contentMainForm.action = action ;
			document.contentMainForm.submit();
		}
		
		function select(action,id){
			location.href = "${ctx}/" + action + "?id=" + id;
		}
		
		function init(){
			document.getElementById("companyName").value = "";
			document.getElementById("email").value = "";
		}
		
		function doDelete(action,id){
			if(confirm('是否确认删除？')){
				location.href = "${ctx}/" + action + "?id=" + id ;
			}
		}
	</script>	
	
	<body>
		<form method="post" action="" name="contentMainForm">
			<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
				<tr>
					<td width="20%" class="td2">  
						公司名称 
					</td>
					<td width="30%" class="td2">
						<input type="text" name="companyName" size="32" value="${companyInfo.companyName}">
					</td>
					<td width="20%" class="td2"> 
						电子邮件
					</td>
					<td width="30%" class="td2">
						<input type="text" name="email" size="32" value="${companyInfo.email}">
					</td>
				</tr>
				<tr>
					<td class="td11" align="left" colspan="4">
						<input type="button" name="find" value="查询" onClick="submitAction('companyInfoSearch.ac');">
						&nbsp;&nbsp;<input type="button" name="new" value="新增" onClick="submitAction('companyInfoNew.ac');">
						&nbsp;&nbsp;<input type="button" name="reset" value="重置" onClick="init()" >
					</td>
				</tr>		
			</table>
			<BR>
			<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
				<tr>
					<td width="10%" class="td1" align="center">
						动作
					</td>
					<td width="20%" class="td1" align="center">
						公司名称
					</td>
					<td width="15%" class="td1" align="center">
						电子邮件
					</td>
					<td width="10%" class="td1" align="center">
						法人代表
					</td>
					<td width="10%" class="td1" align="center">
						年营业收入
					</td>
					<td width="10%" class="td1" align="center">
						月产量
					</td>
					<td width="15%" class="td1" align="center">
						主营业务
					</td>
					<td width="10%" class="td1" align="center">
						删除
					</td>
				</tr>
				<c:forEach var="companyInfo" items="${companyList}">
					<tr>
						<td class="td2" align="center">
							<a href="javascript:select('companyInfoSelect.ac','${companyInfo.id}');">选择</a>
						</td>
						<td class="td2">
							${companyInfo.companyName}
						</td>
						<td class="td2" align="left">
							${companyInfo.email}
						</td>
						<td class="td2" align="left">
							${companyInfo.manager }
						</td>
						<td class="td2" align="right">
							${companyInfo.annualTumover }
						</td>
						<td class="td2" align="left">
							${companyInfo.monthlyProduction }
						</td>
						<td class="td2" align="left">
							${companyInfo.proServer }
						</td>
						<td class="td2" align="center">
							<img src="${ctx}/images/delete0.png" onclick="javascript:doDelete('companyInfoDelete.ac','${companyInfo.id}');">
						</td>
					</tr>
				</c:forEach>
			</table>
		</form>
	
	</body>
</html>